<#include "/layout/header.ftl" />
<#import "/include/ui.ftl" as blue />

<script>
function save_success()
{
	window.location = "${path}/pan/folder_delete_list";
}
function restore_click(id, file)
{
	var url = (file == '1' ? "/pan/folder_state" : "/pan/file_data_state");
	$.simpleConfirm("确定还原？", function(ops)
	{
		$.simpleAjax(url, {id: id, state: 0}, function(o)
		{
			$.successAlert("还原成功", "save_success()", 2000);
		});
	});
}
function delete_click(id, file)
{
	var url = (file == '1' ? "/pan/folder_delete" : "/pan/file_data_delete");
	$.simpleConfirm("确定彻底删除？", function(ops)
	{
		$.simpleAjax(url, {ids: id}, function(o)
		{
			$.successAlert("彻底删除成功", "save_success()", 2000);
		});
	});
}

</script>

<div class="am-g" id="div_grid">
	<div class="am-u-sm-12">
		<table class="am-table am-table-striped am-table-hover">
			<thead>
			<tr>
				<th width="80">序号</th>
				<th>目录名称</th>
				<th width="250">创建时间</th>
				<th width="250">删除时间</th>
				<th width="100">文件数</th>
				<th width="150">文件大小</th>
				<th width="250">操作</th>
			</tr>
			</thead>
			<tbody>
			<#list folderList as vo>
			<tr>
				<td>${vo_index+1}</td>
				<td>${vo.name!}</td>
				<td>${(vo.createTime?datetime)!}</td>
				<td>${(vo.deleteTime?datetime)!}</td>
				<td >${vo.files!}</td>
				<td >${vo.fileSizeName!}</td>
				<td>
					<div class="am-btn-group">
						<a href="javascript:void(0)" onclick="restore_click('${vo.id!}', '1')" class="am-btn am-btn-primary am-btn-sm am-radius">还原</a>
						<a href="javascript:void(0)" onclick="delete_click('${vo.id!}', '1')" class="am-btn am-btn-danger am-btn-sm am-radius">彻底删除</a>
					</div>
				</td>
			</tr>
			</#list>
			<#list fileList as vo>
			<tr>
				<td>${vo_index+1+folderList?size}</td>
				<td>
					<a class="am-icon-file-o am-icon-sm"></a>
					<a href="${vo.url!}" target="_blank">${vo.name!}</a>
				</td>
				<td>${(vo.createTime?datetime)!}</td>
				<td>${(vo.deleteTime?datetime)!}</td>
				<td >${vo.files!"1"}</td>
				<td >${vo.fileSizeName!}</td>
				<td>
					<div class="am-btn-group">
						<a href="javascript:void(0)" onclick="restore_click('${vo.id!}', '2')" class="am-btn am-btn-primary am-btn-sm am-radius">还原</a>
						<a href="javascript:void(0)" onclick="delete_click('${vo.id!}', '2')" class="am-btn am-btn-danger am-btn-sm am-radius">彻底删除</a>
					</div>
				</td>
			</tr>
			</#list>
			</tbody>
		</table>
	</div>
</div>

<#include "/layout/footer.ftl" />